!function () {
   var audioElement  = document.getElementsByTagName('audio');
   if(audioElement.length > 0 ){
        if(audioElement[0].src){
            downloadFile(audioElement[0].src);
            return;
        } else {
            var sourceElement = audioElement[0].getElementsByTagName('source');
            if(sourceElement.length > 0){
                downloadFile(sourceElement[0].src);
                return;
            }
        }
    } else {
        var videoElement  = document.getElementsByTagName('video');
        if(videoElement.length > 0 ){
            var sourceElement = videoElement[0].getElementsByTagName('source');
            if(sourceElement.length > 0 && sourceElement[0].type.indexOf('audio') >= 0){
                downloadFile(sourceElement[0].src);
                return;
            }
        }
    }
    alert("当前页面暂未找到音乐，请在音乐加载完后重试");
}();
function downloadFile(src){
    console.log(src);
    var e = document.createElement('a');
    e.href = src;
    e.download = 'audio';
    e.style.display = 'none';
    document.body.append(e);
    e.click();
};